<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>普通公路资金情况明细表（按文号）</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/Top.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/buttons.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/datagrid-detailview.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/util/jquery.cookie.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/YMLib.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/YWLib.js"></script>
    <script type="text/javascript" charset="utf-8" src="./js/xlsx.full.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/FileServer.min.js"></script>
    <style type="text/css">
        a:link {text-decoration: none;}
        a:visited {text-decoration: none;}
        a:hover {text-decoration: none;}
        a:active {text-decoration: none;}
        #bbtable {border-collapse:collapse;}
        #bbtable thead tr td {text-align:center;font-size:1em;font-weight:bold;border:1px solid #FFEBCD;padding:3px 7px 2px 7px;}
        #bbtable tbody tr td {text-align:center;font-size:1em;border:1px solid #FFEBCD;padding:3px 7px 2px 7px;}
        TD {
            font-size: 12px;
        }
        a{
            text-decoration:none;
        }
        .abgc_td td{padding-right:5px;}
    </style>
    <script type="text/javascript">
        $(function () {
            loadDist1("xzqh",$.cookie("dist"));
            loadUnit1("gydw",$.cookie("unit"));
            loadBmbm3('jhnf','项目年份',new Date().getFullYear());
            loadJsonJhxdwh("jhxdwh", "gs_all_bb");
            // loadjhxdwh("jhxdwh",'gs_all_bb');
            var nf=new Date().getFullYear()
            var yf=new Date().getMonth()+1 < 10 ? '0'+(new Date().getMonth()+1):new Date().getMonth()+1;
            var day=new Date().getDate() < 10 ? '0'+new Date().getDate():new Date().getDate();
            $("#bbsj").datebox("setValue",nf+"-"+yf+"-"+day);
        });
        var str1="";var str2="";var datalists;

        function showBb(){
            // addBbTj($.cookie("unit"),"普通公路项目实施及资金到位情况表",$("#bbsj").datebox("getValue").substring(0,7));
            // var tbody = $("#bblist");
            // tbody.empty();
            // loadjzt();
            // var str="v_0,v_1,v_2,v_3,v_4,v_5,v_6,v_7,v_8,v_9,v_10,v_11,v_12,v_13,v_14,v_15,v_16,v_17";
            // var ss=str.split(",");
            var xzqhdm=$("#xzqh").combotree("getValues");
            if(xzqhdm.length==0){
                xzqhstr= $.cookie("dist2");
            }else if(xzqhdm.length==1){
                if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
                if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
                xzqhstr=xzqhdm[0] ;
            }else{
                xzqhstr= xzqhdm.join(',');
            }

            var gydwdm=$("#gydw").combotree("getValues");
            if(gydwdm.length==0){
                gydwstr= $.cookie("unit2");
            }else if(gydwdm.length==1){
                if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
                if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
                gydwstr=gydwdm[0] ;
            }else{
                gydwstr= gydwdm.join(',');
            }

            var jhxdwh=$("#jhxdwh").combobox("getText");
            if(jhxdwh.substr(0,1)==',')
                jhxdwh=jhxdwh.substr(1,jhxdwh.length);

            $("#grid").datagrid({
                url: '/jxcsxm/tjbb/getZjxdzjdwzjbf.do',
                queryParams: {
                    flag: 0,
                    jhnf: getValuesById("jhnf"),
                    xzqhdm: xzqhstr,
                    sbthcd: $.cookie("unit2").length,
                    gydw: gydwstr,
                    jhxdwh: jhxdwh,
                    bbsj: $("#bbsj").datebox("getValue")
                },
                striped: true,
                pagination: true,
                rownumbers: false,
                pageNumber: 1,
                pageSize: 50,
                pageList: [50, 100, 150, 200],
                height: $(window).height() - 190,
                width: $(window).width() - 20,
                columns: [[
                    {field: 'v_0', title: '计划下达文号', width: 240, align: 'center', rowspan: 2},
                    {field: 'v_1', title: '管养单位', width: 150, align: 'center', rowspan: 2},
                    {field: 'v_2', title: '项目名称', width: 200, align: 'center', rowspan: 2},
                    {field: 'xmlx', title: '项目类型', width: 200, align: 'center', rowspan: 2},
                    {field: 'gcfl', title: '工程分类', width: 200, align: 'center', rowspan: 2},
                    {field: 'v_18', title: '项目进度', width: 200, align: 'center', rowspan: 2},
                    {title: '下达计划情况', align: 'center', colspan:5,rowspan: 1},
                    {title: '资金到位情况', align: 'center', colspan:5,rowspan: 1},
                    {title: '资金拨付情况', align: 'center', colspan:5,rowspan: 1},
                ],[
                    {field: 'v_3', title: '小计', width: 120, align: 'center'},
                    {field: 'v_4', title: '车购税', width: 120, align: 'center'},
                    {field: 'v_5', title: '燃油税', width: 120, align: 'center'},
                    {field: 'v_6', title: '厅统筹', width: 120, align: 'center'},
                    {field: 'v_7', title: '地方自筹', width: 120, align: 'center'},

                    {field: 'v_8', title: '小计', width: 120, align: 'center'},
                    {field: 'v_9', title: '车购税', width: 120, align: 'center'},
                    {field: 'v_10', title: '燃油税', width: 120, align: 'center'},
                    {field: 'v_11', title: '厅统筹', width: 120, align: 'center'},
                    {field: 'v_12', title: '地方自筹', width: 120, align: 'center'},

                    {field: 'v_13', title: '小计', width: 120, align: 'center'},
                    {field: 'v_14', title: '车购税', width: 120, align: 'center'},
                    {field: 'v_15', title: '燃油税', width: 120, align: 'center'},
                    {field: 'v_16', title: '厅统筹', width: 120, align: 'center'},
                    {field: 'v_17', title: '地方自筹', width: 120, align: 'center'},
                ]]
            });

           $.ajax({
                url:"/jxcsxm/tjbb/getZjxdzjdwzjbfSum.do",
                data:'flag=0&jhnf='+getValuesById("jhnf")
                    +"&xzqhdm="+xzqhstr+"&sbthcd="+$.cookie("unit2").length+"&gydw="+gydwstr+"&jhxdwh="+jhxdwh+"&bbsj="+$("#bbsj").datebox("getValue"),
                type:"post",
                dataType:"JSON",
                success:function(msg){
                    $("#jhhj").html(msg.v_3);$("#jhcgs").html(msg.v_4);$("#jhrys").html(msg.v_5);
                    $("#jhttc").html(msg.v_6);$("#jhdfzc").html(msg.v_7);
                    $("#dwhj").html(msg.v_8);$("#dwcgs").html(msg.v_9);$("#dwrys").html(msg.v_10);
                    $("#dwttc").html(msg.v_11);$("#dwdfzc").html(msg.v_12);
                    $("#bfhj").html(msg.v_13);$("#bfcgs").html(msg.v_14);
                    $("#bfrys").html(msg.v_15);$("#bfttc").html(msg.v_16);$("#bfdfzc").html(msg.v_17);
                }
            });
        }
        function exportBb(){
            var xzqhdm=$("#xzqh").combotree("getValues");
            if(xzqhdm.length==0){
                xzqhstr= $.cookie("dist2");
            }else if(xzqhdm.length==1){
                if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
                if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
                xzqhstr=xzqhdm[0] ;
            }else{
                xzqhstr= xzqhdm.join(',');
            }

            var gydwdm=$("#gydw").combotree("getValues");
            if(gydwdm.length==0){
                gydwstr= $.cookie("unit2");
            }else if(gydwdm.length==1){
                if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
                if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
                gydwstr=gydwdm[0] ;
            }else{
                gydwstr= gydwdm.join(',');
            }

            var jhxdwh = $("#jhxdwh").combobox("getText");
            if (jhxdwh.indexOf("全部") != -1) {
                jhxdwh = "";
            } else {
                if (jhxdwh.substr(0, 1) == ',') {
                    jhxdwh = jhxdwh.substr(1,jhxdwh.length);
                }
            }
            var data = "flag=1&jhnf="+getValuesById("jhnf")+"&xzqhdm="+xzqhstr
                +"&sbthcd="+$.cookie("unit2").length+"&gydw="+gydwstr
                +"&jhxdwh="+jhxdwh+
                "&bbsj="+$("#bbsj").datebox("getValue")+"&page=1&rows=300000";
            loadjzt();
            window.location.href = "/jxcsxm/tjbb/getZjxdzjdwzjbf.do?"+data;
            disLoadjzt();
            /*$.post('/jxcsxm/xtgl/exportBb_set.do',{nameValue:str1,colValue:str2},function(){
                window.location.href='/jxcsxm/tjbb/getZjxdzjdwzjbf.do?'+data;
            });*/
            // setTimeout('disLoadjzt()',300000);
        }
    </script>
</head>
<body>
    <div style="text-align: left; font-size: 12px; margin: 0px;">
    <table width="99.9%" border="0" style="margin-top: 1px; margin-left: 1px;" cellspacing="0" cellpadding="0">
        <tr>
            <div id="righttop" style="width:4020px;">
                <div id="p_top">当前位置>&nbsp;统计报表>&nbsp;普通公路资金情况明细表（按文号）</div>
            </div>
        </tr>
        <tr>
            <td align="left" style="padding-left: 10px; padding-right: 10px;">
                <fieldset style="width:99.9%; text-align: left; vertical-align: middle;margin: 8px 0px 0px 0px;">
                    <legend style="padding: 0 0 0 0; font-weight: bold; color: Gray; font-size: 12px;">
                        <font style="color: #0866A0; font-weight: bold"></font>
                    </legend>
                    <div>
                        <table style="margin:7px; vertical-align:middle;" cellspacing="0" class="abgc_td" >

                            <tr height="28">
                                <td align="right">行政区划：</td>
                                <td><select id="xzqh" style="width:160px;"></select></td>
                                <td align="right">管养单位：</td>
                                <td><select id="gydw" style="width:160px;"></select></td>
                                <td align="right">计划年份：</td>
                                <td><select id="jhnf" style="width: 100px;"></select></td>
                                <td align="right">计划文号：</td>
                                <td>
                                    <select id="jhxdwh" style="width: 120px;"></select>
                                </td>
                                <td align="right">报表截止时间：</td>
                                <td>
                                    <input type="text" class='easyui-datebox'
                                           id="bbsj" style="width: 118px;">
                                </td>
                            </tr>
                            <tr height="28">
                                <td colspan="8">
                                    <a id='mybuttion1' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:showBb()" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion1')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion1')"  class="button button-tiny button-rounded button-raised button-primary">查询</a>
                                    <a id='mybuttion2' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:exportBb()" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion2')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion2')"  class="button button-tiny button-rounded button-raised button-primary">导出报表</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
            </td>
        </tr>
        <tr>
            <td style="text-align: left; padding-left: 20px; padding-top: 5px; height: 25px; font-size: 12px;" >
                下达计划情况:【&nbsp;<span id="jhhj" style="font-weight: bold; color: #FF0000">0</span>&nbsp;】万元，
                其中：车购税:【 <span id="jhcgs" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                燃油税：【 <span id="jhrys" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                厅统筹: 【 <span id="jhttc" style="font-weight: bold; color: #FF0000">0</span> 】万元,
                地方自筹:【 <span id="jhdfzc" style="font-weight: bold; color: #FF0000">0</span> 】万元；
                资金到位情况:【&nbsp;<span id="dwhj" style="font-weight: bold; color: #FF0000">0</span>&nbsp;】万元，
                其中：车购税:【 <span id="dwcgs" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                燃油税：【 <span id="dwrys" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                厅统筹: 【 <span id="dwttc" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                地方自筹:【 <span id="dwdfzc" style="font-weight: bold; color: #FF0000">0</span> 】万元；
                资金拨付情况:【&nbsp;<span id="bfhj" style="font-weight: bold; color: #FF0000">0</span>&nbsp;】万元。
                其中：车购税:【 <span id="bfcgs" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                燃油税: 【 <span id="bfrys" style="font-weight: bold; color: #FF0000">0</span> 】万元，
                厅统筹: 【 <span id="bfttc" style="font-weight: bold; color: #FF0000">0</span> 】万元,
                地方自筹:【 <span id="bfdfzc" style="font-weight: bold; color: #FF0000">0</span> 】万元。
            </td>
        </tr>
        <tr>
            <td style="padding-left: 10px; font-size:12px;">
                <div><table id="grid"></table></div>
            </td>
            <%--<td style="padding-top: 10px;padding-left:10px;padding-right:10px;">
                <div id="gddiv" style="width:100%;height: 450px;" >
                    <script type="text/javascript">
                        $("#gddiv").attr('style','width:1500px;height:'+($(window).height()-160)+'px;');
                    </script>
                    <div class="easyui-layout"  fit="true">
                        <div data-options="region:'center',border:false" style="overflow:auto;">
                            <table id='bbtable' width="2000px">
                                <caption align="top" style="font-size:large;font-weight: bolder;">普通公路资金情况明细表（按文号）</caption>
                                <tbody id='biaotou'>
                                    <tr>
                                        <td style="width: 140px;" rowspan="2" colspan="1">计划下达文号</td>
                                        <td style="width: 140px;" rowspan="2" colspan="1">管养单位</td>
                                        <td rowspan="2" colspan="1">项目名称</td>
                                        <td rowspan="1" colspan="5">下达计划情况</td>
                                        <td rowspan="1" colspan="5">资金到位情况</td>
                                        <td rowspan="1" colspan="5">资金拨付情况</td>
                                    </tr>
                                    <tr>
                                        <td>小计</td>
                                        <td>车购税</td>
                                        <td>燃油税</td>
                                        <td>厅统筹</td>
                                        <td>地方自筹</td>
                                        <td>小计</td>
                                        <td>车购税</td>
                                        <td>燃油税</td>
                                        <td>厅统筹</td>
                                        <td>地方自筹</td>
                                        <td>小计</td>
                                        <td>车购税</td>
                                        <td>燃油税</td>
                                        <td>厅统筹</td>
                                        <td>地方自筹</td>
                                    </tr>
                                </tbody>
                                <tbody id="bblist"></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </td>--%>
        </tr>
    </table>
</div>
</body>
</html>
